/**
 * Created by zheng on 2018/7/2.
 */
$(function () {
    /*$('#dg').datagrid({
        url: 'employee.json',
        fitColumns: true,
        pagination: true,
        toolbar: "#tb",
        // <!-- 斑马线-->
        striped: true,
        // <!-- 显示序号-->
        rownumbers: true,
        //指定只能单行选择
        singleSelect: true,

        pageSize: 10,
        //页数选择
        pageList: [10, 20, 30, 40, 50],
        sortName: "id",
        sortOrder: "desc",

        //在请求远程数据的时候发送额外的参数。

        queryParams: {
            name: 'easyui',
            subject: 'datagrid'
        },


        columns: [[
            {field: 'baseInfo', title: '基本属性', colspan: 2, width: 100, align: "center"},
            {field: 'otherInfo', title: '其他属性', colspan: 3, width: 100, align: "center"}
        ], [
            {field: 'id', title: '编码', width: 100},
            {field: 'name', title: '名称', width: 100},
            {field: 'inputTime', title: '入职时间', width: 100},
            {
                field: 'dept', title: '部门', width: 100,
                formatter: function (value, row, index) {
                    return value ? value.name : "未分配部门";
                }

                /!*, align: 'right'*!/
            },
            {
                field: 'state', title: '状态', width: 100,
                formatter: function (value, row, index) {
                    if (value) {
                        return "在职";
                    } else {
                        return "离职";
                    }
                }
                /!*, align: 'right'*!/
            }
        ]]
    });*/
    // alert(110)

    // <%--我的面板--%>
    $('#main_tree1').tree({
        url: '/systemMenu/loadMenuByParentSn?parentSn=panel',
        onClick: function (node) {
            $("#indexUrl").prop("src",node.url)
            $("#parisT").text(node.text)
        },
        onLoadSuccess:function (node, data) {
            var treeS =$('#main_tree1').tree("getChildren");
            for(var treeI=0;treeI<treeS.length;treeI++){
                $(treeS[treeI].target).addClass("tpl-left-nav-item");

            }
        }
    });
    // <%--客户管理--%>
    $('#main_tree2').tree({
        url: '/systemMenu/loadMenuByParentSn?parentSn=client',
        onClick: function (node) {
            $("#indexUrl").prop("src",node.url)
            $("#parisT").text(node.text)
        },
        onLoadSuccess:function (node, data) {
            var treeS =$('#main_tree1').tree("getChildren");
            for(var treeI=0;treeI<treeS.length;treeI++){
                $(treeS[treeI].target).addClass("tpl-left-nav-item");
            }
        }
    });
    // <%--信息管理--%>
    $('#main_tree3').tree({
        url: '/systemMenu/loadMenuByParentSn?parentSn=msg',
        onClick: function (node) {
            $("#indexUrl").prop("src",node.url)
            $("#parisT").text(node.text)
        },
        onLoadSuccess:function (node, data) {
            var treeS =$('#main_tree1').tree("getChildren");
            for(var treeI=0;treeI<treeS.length;treeI++){
                $(treeS[treeI].target).addClass("tpl-left-nav-item");
            }
        }
    });
    // <%--保单管理--%>
    $('#main_tree4').tree({
        url: '/systemMenu/loadMenuByParentSn?parentSn=bill',
        onClick: function (node) {
            $("#indexUrl").prop("src",node.url)
            $("#parisT").text(node.text)
        },
        onLoadSuccess:function (node, data) {
            var treeS =$('#main_tree1').tree("getChildren");
            for(var treeI=0;treeI<treeS.length;treeI++){
                $(treeS[treeI].target).addClass("tpl-left-nav-item");
            }
        }
    });
    // <%--见费出单--%>
    $('#main_tree5').tree({
        url: '/systemMenu/loadMenuByParentSn?parentSn=costbill',
        onClick: function (node) {
            $("#indexUrl").prop("src",node.url)
            $("#parisT").text(node.text)
        },
        onLoadSuccess:function (node, data) {
            var treeS =$('#main_tree1').tree("getChildren");
            for(var treeI=0;treeI<treeS.length;treeI++){
                $(treeS[treeI].target).addClass("tpl-left-nav-item");
            }
        }
    });

    // <%--理赔管理--%>
    $('#main_tree6').tree({
        url: '/systemMenu/loadMenuByParentSn?parentSn=pay',
        onClick: function (node) {
            $("#indexUrl").prop("src",node.url)
            $("#parisT").text(node.text)
        },
        onLoadSuccess:function (node, data) {
            var treeS =$('#main_tree1').tree("getChildren");
            for(var treeI=0;treeI<treeS.length;treeI++){
                $(treeS[treeI].target).addClass("tpl-left-nav-item");
            }
        }
    });
    // <%--报表管理--%>
    $('#main_tree7').tree({
        url: '/systemMenu/loadMenuByParentSn?parentSn=charts',
        onClick: function (node) {
            $("#indexUrl").prop("src",node.url)
            $("#parisT").text(node.text)
        },
        onLoadSuccess:function (node, data) {
            var treeS =$('#main_tree1').tree("getChildren");
            for(var treeI=0;treeI<treeS.length;treeI++){
                $(treeS[treeI].target).addClass("tpl-left-nav-item");
            }
        }
    });
    // <%--系统监控--%>
    $('#main_tree8').tree({
        url: '/systemMenu/loadMenuByParentSn?parentSn=control',
        onClick: function (node) {
            $("#indexUrl").prop("src",node.url)
            $("#parisT").text(node.text)
        },
        onLoadSuccess:function (node, data) {
            var treeS =$('#main_tree1').tree("getChildren");
            for(var treeI=0;treeI<treeS.length;treeI++){
                $(treeS[treeI].target).addClass("tpl-left-nav-item");
            }
        }
    });

    // <%--系统管理--%>
    $('#main_tree9').tree({
        url: '/systemMenu/loadMenuByParentSn?parentSn=system',
        onClick: function (node) {
            $("#indexUrl").prop("src",node.url)
            $("#parisT").text(node.text)
        },
        onLoadSuccess:function (node, data) {
            var treeS =$('#main_tree1').tree("getChildren");
            for(var treeI=0;treeI<treeS.length;treeI++){
                $(treeS[treeI].target).addClass("tpl-left-nav-item");
            }
        }
    });





    //全屏代码---begin

    //全屏代码---end


})
//全屏代码---begin

//全屏代码---end